package com.atguigu.daijia.customer.client;

import com.atguigu.daijia.common.result.Result;
import com.atguigu.daijia.model.form.customer.UpdateWxPhoneForm;
import com.atguigu.daijia.model.vo.customer.CustomerLoginVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

//用户远程调用服务
@FeignClient(value = "service-customer",fallbackFactory = CustomerInfoFeignClientFallback.class,path = "/customer/info")
public interface CustomerInfoFeignClient {
    /**
     * 用户登录远程调用
     * @param code
     * @return
     */
    @GetMapping("/login/{code}")
    public Result<Long> login(@PathVariable String code);

    @GetMapping("/getCustomerLoginInfo")
    public Result<CustomerLoginVo> getCustomerLoginVo(@RequestParam("userId") Long userId);

    @PostMapping("/updateWxPhone")
    Result<Boolean> updateWxPhoneNumber(@RequestBody UpdateWxPhoneForm updateWxPhoneForm);
}